package com.itheima.manyToMany;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Properties;

public interface StudentMapper {
    @Select("select distinct s.id ,s.name  from student s , stu_cr sc where sc.sid = s.id")
    @Results({
            @Result(column = "id" ,property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "age" ,property = "age"),
            @Result(
                    property="courses",
                    javaType =List.class,
                    column = "id",
                    many = @Many(select = "com.itheima.manyToMany.CourseMapper.selectBySid")
            )
    })
    public abstract List<Student> selectAll ();
}
